<extend name="Layout/ins_page" />
<block name="content">
   <link href="/sap/demo.css" rel="stylesheet" type="text/css" />
    <script src="/sap/scripts/boot.js" type="text/javascript"></script>



        <legend><span></span></legend>
        <div  id='fm1'>
        <div class="fieldset-body">
        
   
		<span>品牌名称</span>
		<input  class="mini-textbox" id='c_name'  />
		
    <a class="mini-button" onclick="search()" enabled="" id='query-bt'  style="margin-top: 5px">&nbsp;&nbsp;查询&nbsp;&nbsp;</a> 
 
  
   
    <div id="tabs1" class="mini-tabs" activeIndex="0" style="width:100%;margin-top: 5px;overflow:auto;" plain="false"
    buttons="#tabsButtons"
>
    <div title="品牌列表" >
   
   <div id="datagrid1" class="mini-datagrid" style="height:430px;width: 100%;" 
        url="/SapSupplier/getBrandListDataAll" idField="id"
        allowResize="true" 
        allowCellEdit="true" allowCellSelect="true" multiSelect="true"
        allowCellValid="true" oncellvalidation="" 
    >
    
        <div property="columns">
           
             <div field="b_name"  headerAlign="center"  >品牌名称
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>
            <div field="logo"  headerAlign="center"  >Logo
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
             <div field="ranking"  headerAlign="center"  >行业排名
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>
            <div field="sales_year"  headerAlign="center"  >年销售额（万）
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>
            <div field="suitable"  headerAlign="center"  >适合人群
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>
            <div field="channel"  headerAlign="center"  >建议渠道
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
            <div field="s_price"  headerAlign="center"  >价格区间
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
            <div field="r_reason"  headerAlign="center"  >推荐理由
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
           <div field="relevant_link"  headerAlign="center"  >相关产品链接
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
           <div field="similar_brand_link"  headerAlign="center"  >类似品牌链接
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
           <div field="top_link"  headerAlign="center"  >龙头（爆款）产品推荐
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
           <div field="mainstream_channel"  headerAlign="center"  >主流渠道
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
            <div field="bank_channel_sales"  headerAlign="center"  >银行渠道销售情况
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
            <div field="recommender"  headerAlign="center"  >推荐人
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
            <div field="ctime"  headerAlign="center"  >添加时间
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>

            <div field="examine_status" type="comboboxcolumn"   headerAlign="center"  >审核状态
                <!--<input property="editor" class="mini-combobox" style="width:100%;" data="typeOfProcess" />-->
            </div>
          
        </div>
    </div>
    </div>
    <!-- <div title="Tab2" iconCls="" >
        2
    </div> -->
</div>
</div>
</div>


</body>
<script type="text/javascript">
        mini.parse();
        var grid = mini.get("datagrid1");
        grid.setPageSize(50);
        grid.on("drawcell", function (e) {
        var record = e.record,
        column = e.column,
        field = e.field,
        value = e.value;

            //格式化日期
            if (field == "ctime") {
                if (mini.isDate(value)) e.cellHtml = mini.formatDate(value, "yyyy-MM-dd HH:mm:ss");
				
            }
          
            
            if (field == "relevant_link"||field == "similar_brand_link"||field == "top_link") {
                e.cellHtml = '<a href="' + value + '"  target="_blank"  >' +value+ '</a>';
            }
            
            
            if (field == "b_name") {
            	var url="/SapSupplier/brandedit/id/";
                e.cellHtml = '<a href="' + url+record.b_id + '"  target="_blank"  >' +value+ '</a>';
            }
            
            
            if (field == "logo") {
                e.cellHtml = '<img src="' + value + '"  style="width:50px" >';
            }
            
            if (field == "s_price") {
                e.cellHtml = value+"<br>"+record.e_price;
            }

            if(record.examine_status!=1)
                e.cellStyle = "background:#f9a8a8";

            if (field == "examine_status") {
                e.cellHtml =value==1?"通过":(value==0?"待审核":'未通过') ;
            }

        });

        function search(){
        	var c_name = mini.get('c_name').getValue();
        	
        	grid.load({c_name:c_name})
        }
       

        
     

</script>
    </block>

